import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:namewava/utils/jc_privacy_protocol.dart';
import 'package:namewava/utils/jc_text_style.dart';

class JcAgreeText extends StatelessWidget {
  const JcAgreeText({super.key, this.normalColor, this.hightColor});
  final Color? normalColor;
  final Color? hightColor;

  @override
  Widget build(BuildContext context) {
    return RichText(
      text: TextSpan(
          text: 'By using our App you agree with our  ',
          style: JcTextStyle.octoberDevanagariRegularTextStyle(
              12.sp, normalColor ?? const Color(0xFF1C2355)),
          children: [
            TextSpan(
                text: "Term of Use ",
                style: JcTextStyle.octoberDevanagariRegularTextStyle(
                    12.sp, hightColor ?? Colors.white),
                recognizer: TapGestureRecognizer()
                  ..onTap = () {
                    JcPrivacyProtocol.launchPrivacyProtocol(0);
                    // MgAgreementPolicy.launchAgreement(1);
                  }),
            TextSpan(
              text: "and ",
              style: JcTextStyle.octoberDevanagariRegularTextStyle(
                  12.sp, normalColor ?? const Color(0xFF1C2355)),
            ),
            TextSpan(
                text: "Privacy Policy. ",
                style: JcTextStyle.octoberDevanagariRegularTextStyle(
                    12.sp, hightColor ?? Colors.white),
                recognizer: TapGestureRecognizer()
                  ..onTap = () {
                    JcPrivacyProtocol.launchPrivacyProtocol(1);
                  }),
          ]),
    );
  }
}
